﻿@using beway.common;
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>瀚微互动在线充值系统V1.0 - 管理平台</title> 
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/style.css")" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")"></script>
    <script type="text/javascript">
        $(function () {
            $("#LoginName").select();
            $("#LogOn").click(function () {
                if ($("#LoginName").val() == "") {
                    alert("请输入登录名");
                    $("#LoginName").focus();
                    return false;
                }
                if ($("#Password").val() == "") {
                    alert("请输入密码");
                    $("#Password").focus();
                    return false;
                }
                if ($("#ValidateCode").val() == "") {
                    alert("请输入验证码");
                    $("#ValidateCode").focus();
                    return false;
                }

                $.ajax({
                    url: '/Login/Login', //访问路径
                    data: 'username=' + $("#LoginName").val() + "&pwd=" + $("#Password").val() + "&valcode=" + $("#ValidateCode").val(), //需要验证的参数
                    type: 'post',
                    error: function () {//访问失败时调用的函数
                        alert("登录出错，请重试！");
                    },
                    success: function (jsonData) {//访问成功时调用的函数,这里的msg是/Account/LogOn返回的值
                        if (jsonData == "OK") {
                            location.href = "/Home/Index";
                        }
                        else {
                            $(".valcode").click();
                            alert(jsonData);
                        }
                    }
                });
            });
        });
    </script>
</head>
<body>
    <div class="dl_login">
        <div class="dl_login_top">
            瀚微互动在线充值系统V1.0 - 管理平台
        </div>
        <div class="dl_login_bottom">
            <table width="70%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td height="50" align="right" valign="middle">
                        用户名：
                    </td>
                    <td height="50" align="left" valign="middle">
                        <input id="LoginName" type="text" class="dl_wbk" />
                    </td>
                </tr>
                <tr>
                    <td height="50" align="right" valign="middle">
                        密 码：
                    </td>
                    <td height="50" align="left" valign="middle">
                        <input id="Password" type="password" class="dl_wbk" />
                    </td>
                </tr>
                <tr>
                    <td height="50" align="right" valign="middle">
                        验证码：
                    </td>
                    <td height="50" align="left" valign="middle">
                        <input id="ValidateCode" type="text" class="dl_wbk1 inputcheckbox" />
                        @Html.ValidateCode(new { @class = "inputcheckbox" })
                    </td>
                </tr>
                <tr>
                    <td height="50" align="right" valign="middle">
                        &nbsp;
                    </td>
                    <td height="50" align="left" valign="middle">
                        <input type="button" value="" id="LogOn" class="dl_but" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>
